<template>
  <div class="detail">
    <button @click="back">返回</button>
    <div v-for="item of msg" :key="item._id">
      <div class="dmsg">{{ item.text }}</div>
      <div class="dimg">
        <img :src="$serveUrl + item.url" alt="" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: {},
    };
  },
  mounted() {
    let colelctionName = this.$route.query.collectionName;
    let _id = this.$route.params._id;
    this.$axios({
      url: `/rec/main/${colelctionName}`,
      params: { _limit: 1, _id: _id },
    }).then((res) => {
      this.msg = res.data.detail;
    });
  },
  methods: {
    back(){
      this.$router.go(-1)
    }
  }
};
</script>

<style scoped>
.detail{
    padding: 0rem 0.2rem 0rem;
}
.dimg{
    margin: 0.1rem;
}
.dimg img{
    width: 100%;
    height: 3rem;
}
</style>